<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html lang="en-US">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title>亚彦科技</title>
	<!--[if lt IE 9]>
		<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
		<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
		<script src="Javascript/Flot/excanvas.js"></script>
	<![endif]-->
	<!-- The Fonts -->
	<!-- <link href="http://fonts.useso.com/css?family=Oswald|Droid+Sans:400,700" rel="stylesheet" /> -->
	<!-- The Main CSS File -->
	<link rel="stylesheet" href="<%=basePath %>CSS/style.css" />
	<link type="text/css" rel="stylesheet" href="<%=basePath %>CSS/jedate.css">
	<link rel="icon" href="<%=basePath %>Images/logo.ico" type="image/x-icon"/> 
	<link rel="shortcut icon" href="<%=basePath %>Images/logo.ico" type="image/x-icon"/> 
	<!-- jQuery -->
	<script src="<%=basePath %>Javascript/jQuery/jquery-1.7.2.min.js"></script>
	<!-- Flot -->
	<script src="<%=basePath %>Javascript/Flot/jquery.flot.js"></script>
	<script src="<%=basePath %>Javascript/Flot/jquery.flot.resize.js"></script>
	<script src="<%=basePath %>Javascript/Flot/jquery.flot.pie.js"></script>
	<!-- DataTables -->
	<script src="<%=basePath %>Javascript/DataTables/jquery.dataTables.min.js"></script>
	<!-- ColResizable -->
	<script src="<%=basePath %>Javascript/ColResizable/colResizable-1.3.js"></script>
	<!-- jQuryUI -->
	<script src="<%=basePath %>Javascript/jQueryUI/jquery-ui-1.8.21.min.js"></script>
	<!-- Uniform -->
	<script src="<%=basePath %>Javascript/Uniform/jquery.uniform.js"></script>
	<!-- Tipsy -->
	<script src="<%=basePath %>Javascript/Tipsy/jquery.tipsy.js"></script>
	<!-- Elastic -->
	<script src="<%=basePath %>Javascript/Elastic/jquery.elastic.js"></script>
	<!-- ColorPicker -->
	<script src="<%=basePath %>Javascript/ColorPicker/colorpicker.js"></script>
	<!-- SuperTextarea -->
	<script src="<%=basePath %>Javascript/SuperTextarea/jquery.supertextarea.min.js"></script>
	<!-- UISpinner -->
	<script src="<%=basePath %>Javascript/UISpinner/ui.spinner.js"></script>
	<!-- MaskedInput -->
	<script src="<%=basePath %>Javascript/MaskedInput/jquery.maskedinput-1.3.js"></script>
	<!-- ClEditor -->
	<script src="<%=basePath %>Javascript/ClEditor/jquery.cleditor.js"></script>
	<!-- Full Calendar -->
	<script src="<%=basePath %>Javascript/FullCalendar/fullcalendar.js"></script>
	<!-- Color Box -->
	<script src="<%=basePath %>Javascript/ColorBox/jquery.colorbox.js"></script>
	<!-- Kanrisha Script -->
	<script src="<%=basePath %>Javascript/kanrisha.js"></script>
	
	<script type="text/javascript" src="<%=basePath %>Javascript/jquery.jedate.js"></script>
	
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<script type="text/javascript" charset="utf-8" src="<%=basePath %>ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="<%=basePath %>ueditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="<%=basePath %>ueditor/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=GD7BZ-O2U2U-R4ZVV-47J73-XCXU2-PABNS"></script>
	</head>
<body>
	<!-- Change Pattern -->
	<div class="changePattern">
		<span id="pattern1"></span>
		<span id="pattern2"></span>
		<span id="pattern3"></span>
		<span id="pattern4"></span>
		<span id="pattern5"></span>
		<span id="pattern6"></span>
	</div>
	<!-- Top Panel -->
	<div class="top_panel">
		<div class="wrapper">
			<div class="user">
				<img src="<%=basePath %>Images/user_avatar.png" alt="user_avatar" class="user_avatar" />
				<span class="label">${admin.op_username }</span>
				<!-- Top Tooltip -->
				<div class="top_tooltip">
					<div>
						<ul class="user_options">
							<li class="i_16_logout"><a href="<%=basePath %>back/adminLogout.do" title="注销"></a></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>

	<header class="main_header">
		<div class="wrapper">
			<div class="logo">
				<a href="#" title="亚彦科技">
					<img src="<%=basePath %>Images/kanrisha_logo.png" alt="kanrisha_logo" />
				</a>
			</div>
		</div>
	</header>

	<div class="wrapper contents_wrapper">
		
		<aside class="sidebar">
			<ul class="tab_nav">
				<li class="active_tab">
					<a href="<%=basePath %>back/getMatch.do" title="赛事管理">
						<span class="tab_label">赛事管理</span>
						<span class="tab_info">赛事查询、录入</span>
					</a>
				</li>
				<li class="">
					<a href="<%=basePath %>back/getIntegral.do" title="积分管理">
						<span class="tab_label">积分管理</span>
						<span class="tab_info">积分查询、修改</span>
					</a>
				</li>
				<li class="">
					<a href="<%=basePath %>back/getGrade.do" title="积分等级">
						<span class="tab_label">积分等级</span>
						<span class="tab_info">积分等级查询</span>
					</a>
				</li>
				<li class="">
					<a href="<%=basePath %>back/getNews.do" title="新闻资讯">
						<span class="tab_label">新闻资讯</span>
						<span class="tab_info">新闻资讯查询</span>
					</a>
				</li>
				<li class="">
					<a href="<%=basePath %>back/getBanner.do" title="广告管理">
						<span class="tab_label">广告管理</span>
						<span class="tab_info">广告录入、修改</span>
					</a>
				</li>
			</ul>
		
		</aside>
		<div class="contents">
			<div class="grid_wrapper">

				<div class="g_6 contents_header">
					<h3 class="i_16_forms tab_label">赛事信息</h3>
					<div><span class="label">赛事信息录入</span></div>
				</div>
				<div class="g_12 separator"><span></span></div>

				<div class="g_12">
					<div class="widget_header">
						<h4 class="widget_header_title wwIcon i_16_valid">信息录入</h4>
					</div>
					<div class="widget_contents noPadding">
						<form method="post" action="<%=basePath %>back/saveMatch.do" onsubmit="return checkInput()">
							<div class="line_grid">
								<div class="g_3"><span class="label">赛事名称<span class="must">*</span></span></div>
								<div class="g_9">
									<input type="text" name="name" placeholder="请输入名称" class="simple_field" required />
								</div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">赛事地址<span class="must">*</span></span></div>
								<div class="g_6">
									<input type="text" name="address" id="address" placeholder="请输入赛事地址" class="simple_field" required />
								</div>
								<div class='g_3'><input type="button" class="submitIt simple_buttons" value="地址获取" onclick="codeAddress()"/></div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">地理位置<span class="must">*</span></span></div>
								<div class="g_9" id="container" style="height: 500px;">
								</div>
								<input type="hidden" name="longitude" id="longitude"/>
								<input type="hidden" name="latitude" id="latitude"/>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">开始时间<span class="must">*</span></span></div>
								<div class="g_9">
									<input class="simple_field" id="date01" type="text" name="starDate" placeholder="YYYY-MM-DD hh:mm:ss  年-月-日 时:分:秒" value=""  readonly>
								</div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">结束时间<span class="must">*</span></span></div>
								<div class="g_9">
			 						<input class="simple_field" id="date02" type="text" name="endDate" placeholder="YYYY-MM-DD hh:mm:ss  年-月-日 时:分:秒" value=""  readonly>
								</div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">参赛者票价<span class="must">*</span></span></div>
								<div class="g_6">
									<input type="text" name="eproduct"  placeholder="请输入参赛者票价" value="0" class="simple_field" required />
								</div>
								<div class="g_3">
									<span class="label" style="color: red">注：价格为0时，表示是活动<span class="must">*</span></span>
								</div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">游客票价<span class="must">*</span></span></div>
								<div class="g_9">
									<input type="text" name="sproduct" placeholder="请输入游客票价" class="simple_field" required />
								</div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">赛事简介<span class="must">*</span></span></div>
								<div class="g_9">
									<input type="text" name="text" placeholder="请输入赛事简介" class="simple_field" required />
								</div>
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label">详情介绍<span class="must">*</span></span></div>
								<div class="g_9">
									
								</div>
							</div>
							<div class="g_12">
								<textarea id="editor" style="height:360px" name="detail" required></textarea>
								<script type="text/javascript" charset="utf-8">
									UE.getEditor('editor');
								</script>
								<!-- <div class="widget_contents noPadding">
									<div class="line_grid">
										<div class="g_12">
											<textarea class="simple_field wysiwyg"></textarea>
											<div class="field_notice"></div>
										</div>
									</div>
								</div> -->
							</div>
							<div class="line_grid">
								<div class="g_3"><span class="label"></span></div>
								<div class="g_9">
									<input type="submit" value="提交" class="submitIt simple_buttons" />
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>		
		</div>
	</div>
	<footer>
		<div class="wrapper">
			<span class="copyright">
			</span>
		</div>
	</footer>
</body>
<script type="text/javascript">
	var geocoder, map, marker = null;
	
	var center = new qq.maps.LatLng(39.916527, 116.397128);
	map = new qq.maps.Map(document.getElementById('container'), {
	    center: center,
	    zoom: 18
	});
	
	//地址和经纬度之间进行转换服务
	geocoder = new qq.maps.Geocoder();

 
    function codeAddress() {
        var address = document.getElementById("address").value;
        //对指定地址进行解析
        geocoder.getLocation(address);
        //设置服务请求成功的回调函数
        geocoder.setComplete(function(result) {
            map.setCenter(result.detail.location);
            var marker = new qq.maps.Marker({
                map: map,
                position: result.detail.location
            });
            
            document.getElementById("longitude").value=result.detail.location.lng;
            document.getElementById("latitude").value=result.detail.location.lat;
        });
        //若服务请求失败，则运行以下函数
        geocoder.setError(function() {
            alert("出错了，请输入正确的地址！！！");
        });
    }
    
    function checkInput() {
    	if(document.getElementById("longitude").value.length==0 || document.getElementById("latitude").value.length==0) {
    		alert("请点击“地址获取”！");
    		document.getElementById("address").focus();
    		return false;
    	}
    }

$("#datefix").jeDate({
    //isinitVal:true,
    //festival:true,
    //ishmsVal:false,
    fixedCell:"refix",
    //isClear:false,
    //isok:false,
    hmsSetVal:{hh:00,mm:00,ss:00},
    //isvalid:["3,4,8,10",true],
    initAddVal:{MM:"+3",DD:"+2"},
    minDate: '2016-06-16',
    maxDate: '2025-06-16',
    format:"YYYY-MM-DD hh:mm:ss",
    //format:"hh:mm",
    zIndex:3000,
    choosefun:function (elem,val,date) {
        console.log(val)
        console.log(date)
        //alert(date)
    },
    okfun:function (elem,val,date) {
        console.log(val)
        console.log(date)
        //alert(date)
    }
})
//var dt = new Date(),
//    sm = dt.setMonth(13),
//    gm =  dt.getFullYear()
console.log($.timeStampDate("2017-11-16 10:35:22",false)) 
console.log($.timeStampDate("1513391722",true))
//console.log(gm)

var cancel ={
    minDate:'2015-06-16',
    maxDate:'2017-12-16'
}
var opts = $.extend({
     type:"je",
     minDate:undefined,
     maxDate:undefined
},cancel);
if (opts.type == "je") {
    $("#optsdate").jeDate({
        isinitVal: true,
        festival: true,
        trigger: "click mouseenter focus",
        isTime:false,
        ishmsVal: false,
        minDate: opts.minDate,
        maxDate: opts.maxDate,
        format: "YYYY-MM-DD hh:mm",
        zIndex: 3000,
        okfun:function (elem,val) {
            alert(elem)
        }
    })
}

//实现日期选择联动
var start = {
    format: 'YYYY-MM-DD',
    minDate: '2014-06-16 23:59:59', //设定最小日期为当前日期
    //festival:true,
    maxDate: $.nowDate({DD:0}), //最大日期
    choosefun: function(elem,datas){
        end.minDate = datas; //开始日选好后，重置结束日的最小日期
        endDates();
    },
    okfun:function (elem,datas) {
        alert(datas)
    }
};
var end = {
    format: 'YYYY年MM月DD日',
    minDate: $.nowDate({DD:0}), //设定最小日期为当前日期
    //festival:true,
    maxDate: '2099-06-16 23:59:59', //最大日期
    choosefun: function(elem,datas){
        start.maxDate = datas; //将结束日的初始值设定为开始日的最大日期
    }
};
function endDates() {
    end.trigger = false;
    $("#inpend").jeDate(end);
}
$("#inpstart").jeDate(start);
$("#inpend").jeDate(end);


$("#date01").jeDate({
    //festival:true,
    ishmsVal:false,
    minDate: '2016-06-16 23:59:59',
    maxDate: '2116-06-31 23:59:59',
    format:"YYYY-MM-DD hh:mm:ss",
    zIndex:3000,
})
$("#date02").jeDate({
    //festival:true,
    ishmsVal:false,
    minDate: '2016-06-16 23:59:59',
    maxDate: '2116-06-31 23:59:59',
    format:"YYYY-MM-DD hh:mm:ss",
    zIndex:3000,
})
function testShow(elem){
    $.jeDate(elem,{
        trigger:false,
        isinitVal:true,
        //festival:true,
        //ishmsVal:false,
        minDate: '2016-06-16 23:59:59',
        maxDate: $.nowDate({DD:0}),
        format:"hh",
        zIndex:3000,
    })
}

</script>
</html>